package com.base.action;

import com.base.bean.Cardstuff;
import com.base.service.CardstuffService;
import com.common.util.PagerModel;
import com.core.ssh2.AbstractActionSupport;

public class CardstuffManagerAction extends AbstractActionSupport {
	private static final long serialVersionUID = 6757290545561522451L;

	private CardstuffService cardstuffService;
	
	private Cardstuff cardstuff;
	
	private long stuffno;
	
	private PagerModel pm;
	
	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}
	
	public String goAddCardstuff() throws Exception {
		return SUCCESS;
	}
	
	public String addCardstuff() throws Exception {
		cardstuffService.addCardstuff(cardstuff);
		return SUCCESS;
	}
	
	public String findAllCardstuff() throws Exception {
		pm = cardstuffService.findCardstuffForPager();
		return SUCCESS;
	}
	
	public String findCardstuff() throws Exception {
		cardstuff = cardstuffService.findCardstuff(stuffno);
		return SUCCESS;
	}
	
	public String delCardstuff() throws Exception {
		cardstuffService.removeCardstuff(stuffno);
		return SUCCESS;
	}
	
	public String getCardstuffForUpdate() throws Exception {
		cardstuff = cardstuffService.findCardstuff(stuffno);
		return SUCCESS;
	}
	
	public String updateCardstuff()	throws Exception {
		cardstuffService.updateCardstuff(cardstuff);
		return SUCCESS;
	}

	/**
	 * @return the cardstuff
	 */
	public Cardstuff getCardstuff() {
		return cardstuff;
	}

	/**
	 * @param cardstuff the cardstuff to set
	 */
	public void setCardstuff(Cardstuff cardstuff) {
		this.cardstuff = cardstuff;
	}

	/**
	 * @return the cardstuffService
	 */
	public CardstuffService getCardstuffService() {
		return cardstuffService;
	}

	/**
	 * @param cardstuffService the cardstuffService to set
	 */
	public void setCardstuffService(CardstuffService cardstuffService) {
		this.cardstuffService = cardstuffService;
	}

	/**
	 * @return the pm
	 */
	public PagerModel getPm() {
		return pm;
	}

	/**
	 * @param pm the pm to set
	 */
	public void setPm(PagerModel pm) {
		this.pm = pm;
	}

	/**
	 * @return the stuffno
	 */
	public long getStuffno() {
		return stuffno;
	}

	/**
	 * @param stuffno the stuffno to set
	 */
	public void setStuffno(long stuffno) {
		this.stuffno = stuffno;
	}
	
}
